/* Common Form Validation Styles */
.form-required-field {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-required-label {
    color: #dc3545;
    font-weight: bold;
}

.form-tab-error {
    color: #dc3545;
    font-weight: bold;
}

/* File input validation */
.form-file-input-error {
    border: 2px solid #dc3545 !important;
    border-radius: 4px;
    padding: 2px;
}

.form-file-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-preview-error {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Bootstrap Selectpicker validation */
.bootstrap-select.form-select-error .dropdown-toggle {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Loading and Connection Modals */
.form-loading-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.form-loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    width: 300px;
}

.form-connection-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.form-connection-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    width: 400px;
}

/* Enhanced File Input Validation Styles */
.form-file-input-error {
    border: 2px solid #dc3545 !important;
    border-radius: 4px;
    padding: 2px;
    background-color: rgba(220, 53, 69, 0.05) !important;
}

.form-file-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.form-preview-error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-width: 2px !important;
}

/* Make sure the file input container is properly styled */
.file-input-container {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-top: 5px;
}

/* Style the file input itself */
.form-control-file.form-file-input-error {
    border: 2px dashed #dc3545 !important;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Preview area styling */
.preview {
    border: 2px dashed #ddd;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 10px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview.form-preview-error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-width: 2px !important;
}

.preview img {
    max-width: 100%;
    max-height: 130px;
    display: none;
    border-radius: 4px;
}

.preview-placeholder {
    color: #6c757d;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-preview-error .preview-placeholder {
    color: #dc3545 !important;
    font-weight: 500;
}

/* Label styling for errors */
.form-required-label {
    color: #dc3545 !important;
    font-weight: bold !important;
}


/* Compression notification styles */
.compression-notification {
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    z-index: 1000;
    font-size: 12px;
    padding: 8px 12px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading state for image preview */
.preview .fa-spinner {
    font-size: 24px;
    color: #007bff;
}

.preview.loading {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

/* File input enhancements */
.file-input-container {
    position: relative;
}

.file-info {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
}

.compression-stats {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
    font-size: 11px;
}

.compression-stats .stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.compression-stats .stat:last-child {
    margin-bottom: 0;
}

.stat-improvement {
    color: #28a745;
    font-weight: bold;
}